package com.bootdo.system.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

import com.bootdo.system.dao.TMagazinePicturesDao;
import com.bootdo.system.domain.TMagazinePicturesDO;
import com.bootdo.system.service.TMagazinePicturesService;



@Service
public class TMagazinePicturesServiceImpl implements TMagazinePicturesService {
	@Autowired
	private TMagazinePicturesDao tMagazinePicturesDao;
	
	@Override
	public TMagazinePicturesDO get(Integer id){
		return tMagazinePicturesDao.get(id);
	}
	
	@Override
	public List<TMagazinePicturesDO> list(Map<String, Object> map){
		return tMagazinePicturesDao.list(map);
	}
	
	@Override
	public int count(Map<String, Object> map){
		return tMagazinePicturesDao.count(map);
	}
	
	@Override
	public int save(TMagazinePicturesDO tMagazinePictures){
		return tMagazinePicturesDao.save(tMagazinePictures);
	}
	
	@Override
	public int update(TMagazinePicturesDO tMagazinePictures){
		return tMagazinePicturesDao.update(tMagazinePictures);
	}
	
	@Override
	public int remove(Integer id){
		return tMagazinePicturesDao.remove(id);
	}
	
	@Override
	public int batchRemove(Integer[] ids){
		return tMagazinePicturesDao.batchRemove(ids);
	}

	@Override
	public int removeByMagazine(Integer magazineId, String titlePage) {
		TMagazinePicturesDO tMagazinePictures = new TMagazinePicturesDO();
		tMagazinePictures.setMagazineId(magazineId);
		tMagazinePictures.setPicture(titlePage);
		return tMagazinePicturesDao.removeByMagazine(tMagazinePictures);
	}

	@Override
	public int removeByMagazineId(Integer magazineId) {
		TMagazinePicturesDO tMagazinePictures = new TMagazinePicturesDO();
		tMagazinePictures.setMagazineId(magazineId);
		return tMagazinePicturesDao.removeByMagazine(tMagazinePictures);
	}

}
